package com.starrocks.config;

import com.starrocks.log.LogCollector;
import com.starrocks.log.LogCollectorAppender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * 日志收集器配置
 * 在 Spring 启动时将 LogCollector 注入到 Logback Appender
 */
@Configuration
public class LogCollectorConfig {
    
    @Autowired
    private LogCollector logCollector;
    
    @PostConstruct
    public void init() {
        // 将 LogCollector 设置到 Logback Appender 中
        LogCollectorAppender.setLogCollector(logCollector);
    }
}

